
package com.daguchuangyi.erp_android.model.product;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

public class ProductListWrapper implements Parcelable {

    @SerializedName("products")
    @Expose
    private List<Product> products = new ArrayList<Product>();
    @SerializedName("count")
    @Expose
    private Count count;
    @SerializedName("parameters")
    @Expose
    private List<Parameter_> parameters = new ArrayList<Parameter_>();
    @SerializedName("hasProductWithSearchWord")
    @Expose
    private boolean hasProductWithSearchWord;
    public final static Creator<ProductListWrapper> CREATOR = new Creator<ProductListWrapper>() {


        @SuppressWarnings({
                "unchecked"
        })
        public ProductListWrapper createFromParcel(Parcel in) {
            return new ProductListWrapper(in);
        }

        public ProductListWrapper[] newArray(int size) {
            return (new ProductListWrapper[size]);
        }

    };

    protected ProductListWrapper(Parcel in) {
        in.readList(this.products, (com.daguchuangyi.erp_android.model.product.Product.class.getClassLoader()));
        this.count = ((Count) in.readValue((Count.class.getClassLoader())));
        in.readList(this.parameters, (com.daguchuangyi.erp_android.model.product.Parameter_.class.getClassLoader()));
        this.hasProductWithSearchWord = ((boolean) in.readValue((boolean.class.getClassLoader())));
    }

    public ProductListWrapper() {
    }

    public List<Product> getProducts() {
        return products;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }

    public Count getCount() {
        return count;
    }

    public void setCount(Count count) {
        this.count = count;
    }

    public List<Parameter_> getParameters() {
        return parameters;
    }

    public void setParameters(List<Parameter_> parameters) {
        this.parameters = parameters;
    }

    public boolean isHasProductWithSearchWord() {
        return hasProductWithSearchWord;
    }

    public void setHasProductWithSearchWord(boolean hasProductWithSearchWord) {
        this.hasProductWithSearchWord = hasProductWithSearchWord;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(products);
        dest.writeValue(count);
        dest.writeList(parameters);
        dest.writeValue(hasProductWithSearchWord);
    }

    public int describeContents() {
        return 0;
    }

}
